package com.yc.rh.entities;

public class NewsInfo {
	private int nlid;
	private String nltype;
	private String nltitle;
	private String nlimgName;
	private String nlcontents;
	private String nlimg;
	private String nldate;
	private String text1;
	private String text2;
	private String text3;
	
	
	@Override
	public String toString() {
		return "NewsInfo [nlid=" + nlid + ", nltype=" + nltype + ", nltitle="
				+ nltitle + ", nlimgName=" + nlimgName + ", nlcontents="
				+ nlcontents + ", nlimg=" + nlimg + ", nldate=" + nldate
				+ ", text1=" + text1 + ", text2=" + text2 + ", text3=" + text3
				+ "]";
	}


	public NewsInfo(int nlid, String nltype, String nltitle, String nlimgName,
			String nlcontents, String nlimg, String nldate, String text1,
			String text2, String text3) {
		super();
		this.nlid = nlid;
		this.nltype = nltype;
		this.nltitle = nltitle;
		this.nlimgName = nlimgName;
		this.nlcontents = nlcontents;
		this.nlimg = nlimg;
		this.nldate = nldate;
		this.text1 = text1;
		this.text2 = text2;
		this.text3 = text3;
	}


	public  NewsInfo() {
		super();
	}


	public int getNlid() {
		return nlid;
	}


	public void setNlid(int nlid) {
		this.nlid = nlid;
	}


	public String getNltype() {
		return nltype;
	}


	public void setNltype(String nltype) {
		this.nltype = nltype;
	}


	public String getNltitle() {
		return nltitle;
	}


	public void setNltitle(String nltitle) {
		this.nltitle = nltitle;
	}


	public String getNlimgName() {
		return nlimgName;
	}


	public void setNlimgName(String nlimgName) {
		this.nlimgName = nlimgName;
	}


	public String getNlcontents() {
		return nlcontents;
	}


	public void setNlcontents(String nlcontents) {
		this.nlcontents = nlcontents;
	}

	
	public String getNlimg() {
		return nlimg;
	}


	public void setNlimg(String nlimg) {
		this.nlimg = nlimg;
	}


	public String getNldate() {
		if(nldate!=null && nldate.contains(".")){
			nldate=nldate.substring(0, nldate.indexOf("."));
		}
		return nldate;
	}


	public void setNldate(String nldate) {
		this.nldate = nldate;
	}


	public String getText1() {
		return text1;
	}


	public void setText1(String text1) {
		this.text1 = text1;
	}


	public String getText2() {
		return text2;
	}


	public void setText2(String text2) {
		this.text2 = text2;
	}


	public String getText3() {
		return text3;
	}


	public void setText3(String text3) {
		this.text3 = text3;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((nlcontents == null) ? 0 : nlcontents.hashCode());
		result = prime * result + ((nldate == null) ? 0 : nldate.hashCode());
		result = prime * result + nlid;
		result = prime * result + ((nlimg == null) ? 0 : nlimg.hashCode());
		result = prime * result
				+ ((nlimgName == null) ? 0 : nlimgName.hashCode());
		result = prime * result + ((nltitle == null) ? 0 : nltitle.hashCode());
		result = prime * result + ((nltype == null) ? 0 : nltype.hashCode());
		result = prime * result + ((text1 == null) ? 0 : text1.hashCode());
		result = prime * result + ((text2 == null) ? 0 : text2.hashCode());
		result = prime * result + ((text3 == null) ? 0 : text3.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NewsInfo other = (NewsInfo) obj;
		if (nlcontents == null) {
			if (other.nlcontents != null)
				return false;
		} else if (!nlcontents.equals(other.nlcontents))
			return false;
		if (nldate == null) {
			if (other.nldate != null)
				return false;
		} else if (!nldate.equals(other.nldate))
			return false;
		if (nlid != other.nlid)
			return false;
		if (nlimg == null) {
			if (other.nlimg != null)
				return false;
		} else if (!nlimg.equals(other.nlimg))
			return false;
		if (nlimgName == null) {
			if (other.nlimgName != null)
				return false;
		} else if (!nlimgName.equals(other.nlimgName))
			return false;
		if (nltitle == null) {
			if (other.nltitle != null)
				return false;
		} else if (!nltitle.equals(other.nltitle))
			return false;
		if (nltype == null) {
			if (other.nltype != null)
				return false;
		} else if (!nltype.equals(other.nltype))
			return false;
		if (text1 == null) {
			if (other.text1 != null)
				return false;
		} else if (!text1.equals(other.text1))
			return false;
		if (text2 == null) {
			if (other.text2 != null)
				return false;
		} else if (!text2.equals(other.text2))
			return false;
		if (text3 == null) {
			if (other.text3 != null)
				return false;
		} else if (!text3.equals(other.text3))
			return false;
		return true;
	}
	
	
	
}
